
// import 'element-plus/dist/index.css'
import './assets/main.css'
import { createApp } from 'vue'
import * as ElementPlusIconsVue from '@element-plus/icons-vue'
import { createPinia } from 'pinia'
import 'vant/lib/index.css';
import { Area } from 'vant';
// import 'element-plus/dist/index.css'

// 适配
import './utils/flexible'

import App from './App.vue'
import router from './router'
import { Toast } from 'vant';

const app = createApp(App)

for (const [key, component] of Object.entries(ElementPlusIconsVue)) {
  app.component(key, component)
}

// 裂图自定义指令
app.directive('error', {
  mounted: function (el) {
    el.onerror = function () {
      el.src = 'https://img2.baidu.com/it/u=1974033560,3587909789&fm=253&fmt=auto&app=138&f=JPEG?w=575&h=500'
    }
  }
})


app.use(Toast);
app.use(createPinia())
app.use(router)

app.mount('#app')
app.use(Area);
